<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // var arr = ['吕布', '赵云', '典韦', '关羽', '马超', '张飞']

    // arr.forEach(function (element, index, array) {
    //   console.log(element, index, array)
    // })

    // arr.forEach(ele => console.log(ele))

    // var arr1 = [1, 2, 3, 4, 5]

    // var newArray = arr1.map(function (element, index, array) {
    //   return element * element
    // })
    // console.log(newArray)

    // var res = arr1.map(ele => ele * ele)
    // console.log(res)



    // let list = [
    //   { name: 'mike', age: '16' },
    //   { name: 'rose', age: '14' },
    //   { name: 'jerry', age: '13' },
    //   { name: 'tom', age: '17' }
    // ]

    // let ans = list.map(item => item)
    // console.log(ans);
    var salary = [1000, 5000, 20000, 3000, 10000, 800, 1500]


    var result = salary.filter(function (element, index, array) {
      if (element < 5000) {
        return false
      } else {
        return true
      }
    })
    console.log(result)

    var res = salary.filter(item => item >= 5000)
    console.log(res);


  </script>
</body>

</html>